const point: f32 = 247567353453.7557;

fn main() {
    let a = 5;
    println!("a = {}", a);
    //a = 6;
    //println!("a = {}", a);

     let b: u32 = 2;
     println!("b = {}", b);

     let mut c: u32 = 7;
     println!("c = {}", c);
	
     c = 9;
     println!("c = {}", c);

     println!("point = {}", point);
	
     let d: bool = true;
     println!("d = {}", d);

     let e: i32 = -243534;
     println!("e = {}", e);

     let f: f32 = 2435.254;
     println!("f = {}", f);

     println!("isize = {}", isize::min_value());

     println!("usize = {}", usize::max_value());

     let arr: [u32; 7] = [2,5,4,857,94,958,368];
     println!("arr = {}", arr[0]);

     let stri: char = '哈';
     println!("str = {}", stri);

     let cha: &str = "哈哈哈哈哈和";
     println!("cha = {}", cha);
	
     let tup: (i32, f64, u8) = (500, 6.4, 1);
     //println!("tup = {}", t);
     println!("tup = {}", tup.0);
     println!("tup = {}", tup.1);
     println!("tup = {}", tup.2);
	
     let (x, y, z) = tup;
     println!("x = {}", x);
     println!("y = {}", y);
     println!("z = {}", z);

     show(arr);
     
     //let r: i32 = -87;
     //let res: i32 = plus_one(r);
     println!("res = {}", plus_one(87));

     println!("res = {}", plus_two(87, 43));

     let v = {
         let j = 33;
         j + 1
     };
     println!("v = {}", v);

     if v == 4 {
         println!("牛逼");
     }else if v == 8{
         println!("good");
     }else if v == 10{
         println!("萨瓦迪卡");
     }else{
         println!("@@@@@");
     }
     
     let tf = true;
     let m = if tf{
		9
             }else{
                10
             };
     println!("m = {}", m);

     let mut number = 1;
     while number != 4 {
        println!("{}", number);
        number += 1;
     }
     println!("EXIT");

     let s = ['R', 'U', 'N', 'O', 'O', 'B'];
     let mut i = 0;
     loop {
        let ch = s[i];
        if ch == 'O' {
            break;
        }
        println!("\'{}\'", ch);
        i += 1;
     }

     let list = ['R', 'U', 'N', 'O', 'O', 'B'];
     let mut it = 0;
     let location = loop {
        let ch = s[it];
        if ch == 'O' {
            break it;
        }
        it += 1;
     };
    println!(" \'O\' 的索引为 {}", location);

     let int_list = [10, 20, 30, 40, 50];
     for i in int_list.iter() {
        println!("值为 : {}", i);
     }

     let dd_list = [10, 20, 30, 40, 50];
     for i in 0..5 {
        println!("a[{}] = {}", i, dd_list[i]);
     }

}

fn show(arr: [u32;7]){
     println!("-----------------------------------------------------------");
     for i in &arr{
        println!("{}", i);
     }
}

fn plus_one(x: i32) -> i32 {
    return x + 1;
}

fn plus_two(x: i32, y: i32) -> i32 {
    return x + y;
    //x+y;
}











































